﻿<template>
  <el-container style="height: 800px; border: 0px solid #eee">
    <el-aside width="300px">
      <el-menu
        default-active="1"
        class="el-menu-vertical-demo"
        @open="handleOpen"
        @close="handleClose"
      >
        <router-link to="/page">
          <el-menu-item index="1"><span>表白墙</span></el-menu-item>
        </router-link>
        <router-link to="/market">
          <el-menu-item index="2"><span>跳蚤市场</span></el-menu-item>
        </router-link>
        <router-link to="/recruit">
          <el-menu-item index="3"><span>招募</span></el-menu-item>
        </router-link>
        <router-link to="/find">
          <el-menu-item index="4"><span>找搭子</span></el-menu-item>
        </router-link>
        <router-link to="/article">
          <el-menu-item index="5"><span>发帖</span></el-menu-item>
        </router-link>
        <router-link to="/person">
          <el-menu-item index="6"><span>个人中心</span></el-menu-item>
        </router-link>
      </el-menu>
    </el-aside>

    <el-container>
      <el-header style="text-align: right; font-size: 25px">
        <div
          style="
            position: absolute;
            left: 55%;
            transform: translateX(-50%);
            font-size: 30px;
          "
        >
          表白墙
        </div>
      </el-header>

      <el-main>
        <el-table :data="tableData">
          <el-table-column prop="date" label="日期" width="140">
          </el-table-column>
          <el-table-column prop="name" label="姓名" width="120">
          </el-table-column>
          <el-table-column prop="address" label="地址"> </el-table-column>
        </el-table>
      </el-main>
    </el-container>
  </el-container>
</template>

<style>
.el-header {
  /* background-color: #ffffff; */
  color: #000000;
  line-height: 60px;
}

.el-aside {
  color: #333;
}

a {
  text-decoration: none;
}
</style>

<script>
import axios from "axios";

export default {
  data() {
    return {
      tableData: [],
    };
  },
  mounted() {
    axios.get("http://localhost:8082/list").then((result) => {
      this.tableData = result.data.data;
    });
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>